/*  日志等级类实现
    1.枚举日志等级
    2.提供一个接口 将对应的日志等级转换成字符串
*/

#ifndef __M_LEVEL_H__
#define __M_LEVEL_H__

#include <iostream>
#include <string>

namespace mylog{
    class loglevel{
    public:
        enum class value{
            UNKNOW=0,
            DEBUG,
            INFO,
            WARNING,
            ERROR,
            FATAL,
            OFF 
        };

        static std::string toString(loglevel::value level){
            switch(level){
                case loglevel::value::DEBUG :
                    return "DEBUG";
                case loglevel::value::INFO :
                    return "INFO";
                case loglevel::value::WARNING :
                    return "WARNING";
                case loglevel::value::ERROR :
                    return "ERROR";
                case loglevel::value::FATAL :
                    return "FATAL";
            }
            return "UNKNOW";
        }
    };
}

#endif